import 'package:flutter/cupertino.dart';
import 'package:flutter/material.dart';

///此类专门用来测试使用
class TestApp extends StatefulWidget {
  @override
  State<StatefulWidget> createState() {
    return TestState();
  }
}

List<List<int>> _list = [];

class TestState extends State {
  @override
  Widget build(BuildContext context) {
    _list.clear();
    for (int i = 0; i < 3; i++) {
      List<int> temp = [];
      for (int j = 0; j < 10; j++) {
        temp.add(j);
      }
      _list.add(temp);
    }

    return Scaffold(
        body: ListView.builder(
            itemCount: _list.length,
            itemBuilder: (context, index) {
              return ExpansionTile(
                  title: Text("这是第$index个"), children: _getItem(index));
            }));
  }

  List<Widget> _getItem(int index) {
    List<Widget> wList = [];
    for (int i = 0; i < _list[index].length; i++) {
      wList.add(Center(
        child: Text("呵呵${_list[index][i]}"),
      ));
    }
    return wList;
  }
}
